{% extends "WileadUserManagerBundle::layout.html.twig" %}

{% block container -%}
<form method="get" action="">
    {{ form_rest(filter) }}
    <input class="btn btn-info" type="submit" name="submit-filter" value="搜索" />
    <a class="btn" href="{{ path('manager_video') }}">清空条件</a>
</form>
<h1>视频管理</h1>

<table class="table">
    <thead>
        <tr>
            <th>地址</th>
            <th>介绍</th>
            <th>上传用户</th>
            <th>创建时间</th>
            <th>操作</th>
        </tr>
    </thead>
    <tbody>
        {% for entity in entities %}
            <tr>
                <td>{{ entity.url }}</td>
                <td>{{ entity.description }}</td>
                <td><a href="{{ path('manager_user_show', { 'id': entity.User.id }) }}">{{ entity.User.nickname }}</a></td>
                <td>{% if entity.created %}{{ entity.created|date('Y-m-d H:i:s') }}{% endif %}</td>
                <td>{% if entity.updated %}{{ entity.updated|date('Y-m-d H:i:s') }}{% endif %}</td>
                <td>
                    <ul>
                        <li>
                            <a target="_blank" href="{{ entity.url }}">查看</a>
                            <a class="deleteLink" href="{{ path('manager_video_delete', { 'id': entity.id }) }}">删除</a>
                        </li>
                    </ul>
                </td>
            </tr>
        {% endfor %}
        </tbody>
    </table>

    <div class="row">
        <div class="span12">
            <div class="navigation">
            {{ knp_pagination_render(entities) }}
                </div>
            </div>
        </div>

    {% endblock %}
